{include file="public/header" /}

<div class="col-lg-9">
                <div class="card">
                    <div class="card-header">
                        <strong class="card-title">评论——食物</strong>
                    </div>
                    <div class="card-body">
                        <table class="table table-bordered">
                            <thead>
                <tr>
                    <th>评论编号</th>
                    <th>信息编号</th>
                    <th>用户编号</th>
                    <th>评论内容</th>
                    <th>评论时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <ul>
                    <?php if (isset($emps)): foreach ($emps as $emp): ?>
                    <tr>
                        <td><?php echo $emp['comment_id'] ?></td>
                        <td><?= $emp['food_id'] ?></td>
                        <td><?= $emp['user_id'] ?></td>
                        <td><?= $emp['text'] ?></td>
                        <td><?= $emp['time'] ?></td>
                        <td>
                            
                            <button onclick="showDel('<?= $emp['comment_id'] ?>', '<?= $emp['text'] ?>')" class="layui-btn layui-btn-danger layui-btn-xs">删除</button>
                         
                        </td>
                    </tr>
                    <?php endforeach; endif; ?>
                </ul>
                </tbody>
                        </table>
                    </div>
               
            </div>
        </div>


</div>


<!-- Scripts -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@2.2.4/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.4/dist/umd/popper.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/js/bootstrap.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jquery-match-height@0.7.2/dist/jquery.matchHeight.min.js"></script>
    <script src="__STATIC__/js/main.js"></script>

    <!--  Chart js -->
    <script src="https://cdn.jsdelivr.net/npm/chart.js@2.7.3/dist/Chart.bundle.min.js"></script>

    <!--Chartist Chart-->
    <script src="https://cdn.jsdelivr.net/npm/chartist@0.11.0/dist/chartist.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chartist-plugin-legend@0.6.2/chartist-plugin-legend.min.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/jquery.flot@0.8.3/jquery.flot.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/flot-pie@1.0.0/src/jquery.flot.pie.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/flot-spline@0.0.1/js/jquery.flot.spline.min.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/simpleweather@3.1.0/jquery.simpleWeather.min.js"></script>
    <script src="__STATIC__/js/init/weather-init.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/moment.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/fullcalendar@3.9.0/dist/fullcalendar.min.js"></script>
    <script src="__STATIC__/js/init/fullcalendar-init.js"></script>

    <!--Local Stuff-->
    <script src="__STATIC__/layui/layui.js"></script>
    




<script>
    //JavaScript代码区域
    layui.use(['element','layer','laypage'], function(){
        var element = layui.element;
        var layer = layui.layer;
        var laypage = layui.laypage;

        laypage.render({
            elem: 'listpage'
            ,count: 70 //数据总数，从服务端得到
            ,jump: function(obj, first){
                //obj包含了当前分页的所有参数，比如：
                console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                console.log(obj.limit); //得到每页显示的条数

                //首次不执行
                if(!first){
                    //do something
                }
            }
        });
    });

    function showDel(name, no) {
        var layer = layui.layer;

        layer.confirm('确认删除' + name + '？', {
            btn: ['确认', '取消'] //可以无限个按钮
        }, function(index, layero){
            //按钮【按钮一】的回调
            location.href = 'del/no/'+no;
            console.log(index)
        }, function(index){
            //按钮【按钮二】的回调
            console.log(index)
        });

    }


</script>
</body>
</html>